package com.gupao.templatedemo.jdbctemplatedemo.dao;

import com.gupao.templatedemo.jdbctemplatedemo.JdbcTemplate;
import com.gupao.templatedemo.jdbctemplatedemo.RowMapper;
import com.gupao.templatedemo.jdbctemplatedemo.entity.Member;

import java.sql.ResultSet;
import java.util.List;

public class MemberDao {
    public JdbcTemplate jdbcTemplate = new JdbcTemplate(null);
    public List<?> query(){
        String sql = "SELECT * FROM t_member";
        return jdbcTemplate.executeQuery(sql, new RowMapper<Member>() {
            @Override
            public Member mapRow(ResultSet rs, int rowNum) throws Exception {
                Member member = new Member();
                member.setPassWord("123456");
                member.setUserName("userName");
                return member;
            }
        },null);
    }
}
